package cfdt.ldl.signature.api.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import cfdt.common.vo.ObjectBaseResponse;
import cfdt.ldl.signature.api.feign.fallback.SignatureFallBack;
import cfdt.ldl.signature.api.request.SignatrueRequest;
import cfdt.ldl.signature.api.response.SignatureResponse;
import cfdt.common.exception.CodeException;

/**
 * 签名验签
 *
 * <pre>
 * Modify Information:
 * Author       Date          Description
 * ============ ============= ============================
 * wangxiao      2021年7月29日上午10:38:36      创建feign类
 *
 * </pre>
 */
@FeignClient(value = "ldl-signature", fallbackFactory = SignatureFallBack.class, path = "ldl-signature")
public interface SignatureFeign {

    /**
     * 签名
     * 
     * @param signatrueRequest
     * @return
     * @throws CodeException
     */
    @PostMapping("/signature/sign")
    ObjectBaseResponse<SignatureResponse> sign(@RequestBody SignatrueRequest signatrueRequest) throws CodeException;

    /**
     * 验签
     * 
     * @param signatrueRequest
     * @return
     * @throws CodeException
     */
    @GetMapping("/signature/verify")
    ObjectBaseResponse<SignatureResponse> verify(@RequestBody SignatrueRequest signatrueRequest) throws CodeException;

}
